package com.mew.slots.core.game.sgj;

import com.mew.common.rest.bo.GameSession;
import com.mew.slots.core.common.handler.AbstractBetHandler;
import com.mew.slots.core.common.handler.SlotsHandler;
import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.common.messge.response.SlotsPlayResponseMessage;
import com.mew.slots.core.common.vo.StrategyGameVO;
import com.mew.slots.core.game.sgj.roller.SgjIli;
import com.mew.slots.core.game.sgj.room.SgjRoom;
import com.mew.slots.core.game.sgj.service.SgjService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Service
@SlotsHandler(value = "SGJ")
@Slf4j
public class SgjHandler extends AbstractBetHandler {

    private SgjService sgjService = new SgjService();

    @Override
    public void readRoller() throws Exception{
        SgjIli.getInstance().init();
    }

    @Override
    public void specialCheck(StrategyGameVO gameVO, GameSession userVO) {

    }

    @Override
    public SlotsPlayResponseMessage play(StrategyGameVO gameVO, GameSession userVO) {
        return sgjService.Ready(gameVO);
    }

    @Override
    public SlotsBonusPlayResponseMessage playBonus(StrategyGameVO gameVO, GameSession userVO) {
        return sgjService.bouns(gameVO);
    }

    public static void main(String[] args) {
        SgjRoom sgjRoom = new SgjRoom();
        int[] a = {9,3,3,10,4,
        10,7,10,3,3,
        0,10,6,6,4};
        sgjRoom.initTest(a,9);
        sgjRoom.roundPlayTest();

        System.out.println(sgjRoom.res);
        System.out.println(54000/9*sgjRoom.res.multiple);
        System.out.println(150000-54000/9*sgjRoom.res.multiple);
    }
}
